package com.headStorm.streamUse;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Stream;

public class StreamUseDemo {

    public static void main(String[] args) {
        Stream<String> stream = Stream.of("I", "love", "you", "too");
//        stream.forEach(str -> System.out.println(str));
//        stream.forEach(System.out::println);
        List<Person> personList = new ArrayList<>();
        personList.add(new Person("欧阳雪",18,"中国",'F'));
        personList.add(new Person("Tom",24,"美国",'M'));
        personList.add(new Person("Harley",22,"英国",'F'));
        personList.add(new Person("向天笑",20,"中国",'M'));
        personList.add(new Person("李康",22,"中国",'M'));
        personList.add(new Person("小梅",20,"中国",'F'));
        personList.add(new Person("何雪",21,"中国",'F'));
        personList.add(new Person("李康",22,"中国",'M'));
    }
}

class Person {
    private String name;
    private Integer age;
    private String country;
    private char sex;

    public Person(String name, Integer age, String country, char sex) {
        this.name = name;
        this.age = age;
        this.country = country;
        this.sex = sex;
    }
}
